{% extends 'system_template/public/base_main.html' %}
{% block cite %}
    单独页面设置（管理）
{% endblock %}
{% block head %}
    <script charset="utf-8" src="{{ url_for('static',filename='lib/kindeditor/kindeditor-all.js') }}"></script>
    <script charset="utf-8" src="{{ url_for('static',filename='lib/kindeditor/lang/zh-CN.js') }}"></script>
    <script src="{{ url_for('static',filename='js/cxcolor.min.js') }}"></script>
    <script>
        KindEditor.ready(function (K) {
            {% for foo in form %}
                window.{{ foo.name }} = K.create('#{{ foo.name }}', {
                    uploadJson: '{{ url_for('sys_bp.upload') }}',
                    allowFileManager: false,
                    wellFormatMode: true,
                    resizeType: 1,
                    formatUploadUrl: false
                });
            {% endfor %}
        });
    </script>
{% endblock %}
{% block content %}
    <form>
        <div class="layui-tab layui-tab-brief" style="margin: -10px 0;">
            <ul class="layui-tab-title">
                {% for foo in form %}
                    {% if loop.index==1 %}
                        <li class="layui-this">{{ foo.label }}</li>
                    {% else %}
                        <li>{{ foo.label }}</li>
                    {% endif %}
                {% endfor %}

            </ul>
            <div class="layui-tab-content">
                {% for foo in form %}
                    {% if loop.index==1 %}
                        <div class="layui-tab-item layui-show">{{ foo }}</div>
                    {% else %}
                        <div class="layui-tab-item">{{ foo }}</div>
                    {% endif %}
                {% endfor %}
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 15px;width: 80%;">
            <div class="layui-input-block" style="text-align: center;margin-left: 0">
                <a class="layui-btn" onclick="submit()">提交保存</a>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
{% endblock %}
{% block footer %}
    <script>
        $(function () {
            tl_init();

        });

        function tl_init() {
            var iframe_0 = $('iframe:eq(0)');
            var height = iframe_0.css('height');
            $('iframe').css('height', height);
            $('.ke-edit').css('height', height);
            $('.ke-edit>textarea').css('height', height)
        }

        function submit() {
                {% for foo in form %}var {{ foo.name }}_ = {{ foo.name }};{{ foo.name }}_.sync();{% endfor %}submit_post();
        }
    </script>
{% endblock %}